<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h3 {
            text-align: center;
        }

        table {
            border-collapse: collapse;
            margin: 0 auto;
        }

        table tr td {
            border: 1px solid #000;
            padding: 5px 20px;
            text-align: center;
        }
    </style>

</head>

<body>
    <h3>
        订单确认
    </h3>
    <script>
        let price, num, total, address
        price = +prompt("请输入商品价格")
        num = +prompt("请输入商品数量")
        total = price * num
        address = prompt("请输入收货地址")
        document.write(`
            <table>
                <tr>
                    <td>商品名称</td>
                    <td>商品价格</td>
                    <td>商品数量</td>
                    <td>总价</td>
                    <td>收货地址</td>
                </tr>
                <tr>
                     <td>iphone 18 pro max</td>
                    <td>${price}元</td>
                    <td>${num}</td>
                    <td>${total}元</td>
                    <td>${address}</td>
                </tr>
            </table>
        `)
    </script>
</body>

</html>